#include<iostream>
#include<unistd.h>
#include<thread>
using namespace std;
void one_func()
{
    cout<<"one   thread begin"<<endl;
    sleep(3);
    cout<<"one   thread end"<<endl;
}
int main()
{
    thread p1(one_func);
    if(p1.joinable()) {
        cout<<"p1 can exec join or detach"<<endl;
    } else {
        cout<<"p1 can not exec join or detach"<<endl;
    }
    p1.join();
    if(p1.joinable()) {
        cout<<"p1 can exec join or detach"<<endl;
    } else {
        cout<<"p1 can not exec join or detach"<<endl;
    }
    return 0;
}